﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Models;
using System.Data;

namespace BLL
{
    public class WxPayAddBLL
    {
        public static int PayAdd(string openid, double money, string time)
        {
            return WxPayAddDAL.addPayTolssj(openid,money,time);
        }

        public static bool isExistRecord(string openid,string time, string out_trade_no)
        {
            int i = WxPayAddDAL.isExists(openid,time, out_trade_no);
            if (i > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public static int addNativeRecord(string order_no, string cardno, string openid, string is_subscribe, string trade_type, string total_fee, string transaction_id, string time_end)
        {
            return WxPayAddDAL.addNativeRecord(order_no, cardno, openid, is_subscribe, trade_type, total_fee, transaction_id, time_end);
        }
        public static int SlotCardPayRecord(SlotCardPay sc)
        {
            return WxPayAddDAL.SlotCardPayRecord(sc);
        }

            /// <summary>
            /// 获取微信支付基础信息
            /// </summary>
            /// <returns></returns>
            public static DataTable getWxPayInfo()
        {
            return WxPayAddDAL.getWxPayInfo();
        }
        /// <summary>
        /// 设置微信支付基础信息
        /// </summary>
        /// <param name="wp"></param>
        /// <returns></returns>
        public static int setWxPayInfo(WxPayInfo wp)
        {
            return WxPayAddDAL.setWxPayInfo(wp);
        }
        /// <summary>
        /// 获取支付宝支付基础信息
        /// </summary>
        /// <returns></returns>
        public static DataTable getAliPayInfo()
        {
            return WxPayAddDAL.getAliPayInfo();
        }
        /// <summary>
        /// 设置支付宝支付基础信息
        /// </summary>
        /// <param name="ap"></param>
        /// <returns></returns>
        public static int setAliPayInfo(AlipayInfo ap)
        {
            return WxPayAddDAL.setAliPayInfo(ap);
        }
    }
}
